<?
require( "Application.php");
$appManager = new AppManager();
$expectedKey = $appManager->getKey();
if($expectedKey != $_POST["keyfield"])
  echo "Key is not correct";
else {
	$storeManager = new StoreManager();
echo $storeManager->saveStore(
	$_POST["storeName"], 
	$_POST["address"], 
	$_POST["city"], 
	$_POST["state"], 
	$_POST["zip"],
	$_POST["lat"],
	$_POST["lng"],
	$_POST["phone"],
	$_POST["website"],
	$_POST["twitter"],
	$_POST["facebook"],
	$_POST["searchterm"]);	
	
}
require( "OnRequestEnd.php"); 
?>